import request from '@/utils/request';

// 场地活动列表
export const getBookFieldList = (params) => {
  return request({
    url: '/book/field/list',
    method: 'get',
    params: params,
  });
};

// 场地活动信息
export const getBookFieldInfo = (id, params) => {
  return request({
    url: `/book/field/getInfo/${id}`,
    method: 'get',
    params: params,
  });
};

// 保存场地活动
export const addBookField = (data) => {
  return request({
    url: '/book/field/add',
    method: 'post',
    data,
  });
};

// 修改场地活动
export const editBookField = (data) => {
  return request({
    url: '/book/field/edit',
    method: 'put',
    data,
  });
};

// 场地选项列表
export const getBookOptionList = (params) => {
  return request({
    url: '/book/option/list',
    method: 'get',
    params: params,
  });
};

// 场地选项信息
export const getBookOptionInfo = (id, params) => {
  return request({
    url: `/book/option/getInfo/${id}`,
    method: 'get',
    params: params,
  });
};

// 保存场地选项
export const addBookOption = (data) => {
  return request({
    url: '/book/option/add',
    method: 'post',
    data,
  });
};

// 修改场地选项
export const editBookOption = (data) => {
  return request({
    url: '/book/option/edit',
    method: 'put',
    data,
  });
};

// 场地领取记录列表
export const getBookRecordList = (params) => {
  return request({
    url: '/book/record/list',
    method: 'get',
    params: params,
  });
};

// 保存场地领取记录
export const addBookRecord = (data) => {
  return request({
    url: '/book/record/add',
    method: 'post',
    data,
  });
};
